<?php

namespace app\admin\validate;

use think\Validate;

class Scenic extends Validate
{
    protected $failException = true;

    /**
     * 验证规则
     */
    protected $rule = [
        'name' => 'require',
        'cate_id' => 'require',
        'cover' => 'require',
        'normal_price' => 'require',
        'vip_price' => 'require',
        'banner' => 'require',
        'address' => 'require',
        'latitude' => 'require',
        'longitude' => 'require',
        'limit_nums' => 'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'name.require' => '请填写景点名称',
        'cate_id.require' => '请选择分类',
        'cover.require' => '请上传封面',
        'normal_price.require' => '请设置价格',
        'vip_price.require' => '请设置会员价格',
        'banner.require' => '请上传轮播图',
        'address.require' => '请填写地址',
        'latitude.require' => '请填写纬度',
        'longitude.require' => '请填写经度',
        'limit_nums.require' => '请填写每天限制数量',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => ['name','cate_id','cover','limit_nums','normal_price','vip_price','banner','address','latitude','longitude'],
    ];

}
